<template>
  <view class="mine-infoitem-page">
    <view class="mine-infoitem-content">
      <view class="mine-infoitem-flex">
        <view>预估到货周期</view>
        <view>{{ supplierInfo.expDeliveryTime ? supplierInfo.expDeliveryTime + '天' : '' }}</view>
      </view>
      <view class="mine-infoitem-flex">
        <view>联系人</view>
        <view>{{ supplierInfo.contactName }}</view>
      </view>
      <view class="mine-infoitem-flex">
        <view>联系人电话</view>
        <view>{{ supplierInfo.contactPhone }}</view>
      </view>
    </view>
    <view class="mine-infoitem-tip">*贵司常规发货周期，如有变动请及时通知到联系人。</view>
  </view>
</template>

<script setup lang="ts">
import { supplierQuerySupplierInfo } from '@/genapi/supplier'

const supplierInfo = reactive({
  expDeliveryTime: '',
  contactName: '',
  contactPhone: '',
})
onMounted(() => {
  getBaseInfo()
})

async function getBaseInfo() {
  const params = {}
  const { data } = await supplierQuerySupplierInfo(params)
  supplierInfo.expDeliveryTime = data.data.supplierInfo.expDeliveryTime
  supplierInfo.contactName = data.data.supplierInfo.contactName
  supplierInfo.contactPhone = data.data.supplierInfo.contactPhone
}
</script>

<style scoped>
.mine-infoitem-page {
  padding: 0 24rpx;
}

.mine-infoitem-content {
  margin-top: 24rpx;
  background-color: #fff;
  border-radius: 16rpx;
}

.mine-infoitem-flex {
  display: flex;
  justify-content: space-between;
  line-height: 108rpx;
  padding-left: 24rpx;
  padding-right: 36rpx;
}

.mine-infoitem-tip {
  font-size: 24rpx;
  color: #999999;
  margin-top: 16rpx;
  padding-left: 24rpx;
  padding-right: 36rpx;
}
</style>
